from Dealmap import Service
from Dealmap import CenterdActivity
from Dealmap import Capability
from Dealmap import ProposedDeal
from pprint import pprint
import datetime



if __name__ == "__main__":
    deal = Service("0-673995604-634157758518545000")
        
    date = datetime.date.today() + datetime.timedelta(4)
    deals = deal.search_deals(CenterdActivity.Kids, Capability.Unknown, date, "+47.60621-122.332071")
    for key in deals.Results:
        pprint(key)
    pprint(deals)

    things = deal.search_business_listings(CenterdActivity.Casual | CenterdActivity.Kids, "Redmond, WA", "fun", 40.3, 4, 100)
    pprint(things)

    newDeal = ProposedDeal(
            title = "Dev",
            expirationDate = date,
            addedBy = "propablyandrew",
            country = "USA",
            city= "Cupertino",
            state = "CA",
            businessName = "A-124-7 Locksmith",
            streetAddress = "20630Valley Green Dr",
            latitude = 29.98285500000003003,
            longitude = -41.48437500030030303,
            #optional
            restrictions = "DEV",
            styles = CenterdActivity.Casual | CenterdActivity.Kids,
            category = "HomeGarden",
            socialNetworkId = 100000136203978,
            effectiveDate = datetime.date.today()
        )

    stuff = deal.submit_deal(newDeal)
    print(stuff)

    print "done"
    
    